package io.zhaocy.exception.mvc.service;

import io.zhaocy.exception.ServiceException;
import io.zhaocy.exception.mvc.model.User;
import org.springframework.stereotype.Service;

/**
 * Description:
 *
 * @Author: genezhao
 * @Date: 2018-07-05
 */
@Service
public class UserService {

    public User getUserById(String id) {
        if (!"2".equals(id)) {
            throw new ServiceException("id不存在");
        }

        return new User(id, "gene", 30);
    }
}
